package com.estylesoft.pshevch.tests;

import org.testng.annotations.*;
import static org.junit.Assert.*;

public class SearchMoviesTestPack extends com.estylesoft.pshevch.tests.TestBase {

    @BeforeClass

    @Test
    public void searchForExistingMovie() throws Exception {

        String searchString = appManager.getMovieHelper().getRandomMovieTitle();

        appManager.getMovieHelper().searchMovieByName(searchString);

        assertEquals(appManager.getMovieHelper().movieListNotEmpty(), true);

        appManager.getMovieHelper().clearSearchField();
    }

    @Test
    public void searchForNonExistingMovie() throws Exception {

        String searchString = appManager.getMovieHelper().getNonExistentMovieName();

        appManager.getMovieHelper().searchMovieByName(searchString);

        assertEquals(appManager.getMovieHelper().getMovieListContentText(), "No movies where found.");

        appManager.getMovieHelper().clearSearchField();
    }

}
